<div class="row-fluid" xmlns="http://www.w3.org/1999/html">
    <div class="navbar no-margin">
        <div class="navbar-inner">
            <ul class="breadcrumb">
                <i class="icon-chevron-left hide-sidebar"><a href='#' title="Hide Sidebar" rel='tooltip'>&nbsp;</a></i>
                <i class="icon-chevron-right show-sidebar" style="display:none;"><a href='#' title="Show Sidebar"
                        rel='tooltip'>&nbsp;</a></i>
                <li>
                    <a href="#/onduty">首页</a>
                </li>
                <li>
                    <a href="#/star/onduty/ticket_list/rg/0">工单列表</a>
                </li>
                <li class="active">工单详情</li>
            </ul>
        </div>
    </div>
</div>

<div class="container-fluid">

    <div class="row">
        <div class="col-sm-12 col-md-12 main">
            <div class="col-md-6 col-md-offset-3">
                <div class="form-group">
                    <!--                        style="display: none;"-->
                    <label style="padding: 0 0 5px">工单类型【数据治理，系统异常，服务支持，政策规范】</label>
                    <!--                            <input type="text" class="form-control" name="type" ng-model="vm.p.type"  />-->
                    <select ng-disabled="vm.isDisabled" name="type" ng-model="vm.p.type" ng-init="vm.p.type='data'"
                            class="form-control">
                        <option value="data">数据治理</option>
                        <option value="bug">系统异常</option>
                        <option value="service">服务支持</option>
                        <option value="account">权限申请</option>
                        <option value="host">主机申请</option>
                        <option value="policy">规范政策</option>
                    </select>
                    <span ng-show="form.type.$error.required" class="help-block">问题类型!</span>
                </div>
                <div class="form-group">
                    <label style="padding: 0 0 5px">事项细分【数据问题, 操作问题, 软件故障, 中间件故障， 其他事务】</label>
                    <!--                            <select  class="form-control" ng-options="act for act in activities"></select>-->
                    <select ng-disabled="vm.isDisabled" name="category" ng-model="vm.p.category"
                            ng-init="vm.p.category='数据问题'" class="form-control">
                        <option>数据问题</option>
                        <option>操作问题</option>
                        <option>软件故障</option>
                        <option>中间件故障</option>
                        <option>其他事务</option>
                    </select>
                    <!--                            <input type="text" class="form-control" name="category" ng-model="vm.p.category"  />-->
                </div>
                <div class="form-group">
                    <label style="padding: 0 0 5px">紧急程度（严重的-电话、短信、美事、邮件。紧急的-短信、美事、邮件。其他-美事、邮件）</label>
                    <!--                            <input type="text" class="form-control" name="severity" ng-model="vm.p.severity"  />-->
                    <select ng-disabled="vm.isDisabled" ng-model="vm.p.severity" ng-init="vm.p.severity='normal'"
                            name="severity" class="form-control">
                        <option value="critical">严重的</option>
                        <option value="urgent">紧急的</option>
                        <option value="high">高的</option>
                        <option value="normal">一般的</option>
                        <option value="low">低的</option>
                    </select>
                    <span ng-show="form.severity.$error.required" class="help-block">紧急程度!</span>
                </div>
<!--                    <div class="form-group">-->
<!--                        <label style="padding: 0 0 5px">事件ID</label>-->
<!--                        <input type="text" class="form-control" name="eventId" ng-model="vm.p.eventId" />-->
<!--                    </div>-->
                <div class="form-group"
                    ng-class="{'has-error':form.subject.$error.required,'has-success':!form.subject.$error.required}">
                    <label style="padding: 0 0 5px">工单标题</label>
                    <input ng-disabled="vm.isDisabled" type="text" class="form-control" name="subject"
                        ng-model="vm.p.subject" required />
                    <!--                        <span ng-show="form.subject.$error.required" class="text-error">主题!</span>-->
                    <span ng-show="form.subject.$error.required" class="help-block">请输入工单标题</span>
                </div>
                <div class="form-group"
                    ng-class="{'has-error':form.description.$error.required,'has-success':!form.description.$error.required}">
                    <label style="padding: 0 0 5px">工单详情</label>
                    <textarea ng-disabled="vm.isDisabled" class="form-control" name="description"
                        ng-model="vm.p.description" style="height: 80px" required></textarea>
                    <span ng-show="form.description.$error.required" class="help-block">请输入工单描述</span>
                </div>
                <div class="form-group">
                    <label style="padding: 0 0 5px">工单备注</label>
                    <input type="text" class="form-control" name="noteReason" ng-model="vm.p.noteReason" ng-init="'-'" />
                </div>
                <!-- <div class="form-group" ng-class="{'has-error':form.location.$error.required,'has-success':!form.location.$error.required}">
                    <label style="padding: 0 0 5px">所属团队</label>
                    <input ng-disabled="vm.isDisabled" required type="text" class="form-control" name="location" ng-model="vm.p.location"/>
                    <span ng-show="form.location.$error.required" class="help-block">请输入您所在的团队</span>
                </div> -->

                <div class="form-group">
                    <label style="padding: 0 0 5px">工单状态</label>
                    <!--                            <input type="text" class="form-control" name="status" ng-model="vm.p.status"  />-->
                    <select ng-model="vm.p.status" ng-init="vm.p.status='opened'" class="form-control">
                        <option value="opened">待处理</option>
                        <option value="processing">处理中</option>
                        <option value="resolved">待验证</option>
<!--                            <option value="misreport">误报</option>-->
                        <option value="closed">已关闭</option>
                        <option value="invalid">已废除</option>
                    </select>
                    <!--                            <span ng-show="form.status.$error.required" class="help-block" >状态!</span>-->
                </div>
                <div class="form-group">
                    <label style="padding: 0 0 5px">工单受理指派</label>
                    <input id="person" type="radio" name="assignType" ng-model="vm.d.assignType" value="person" >
                    <label for="person">处理人</label>
                    <input id="resolvegroup"  type="radio" name="assignType" ng-model="vm.d.assignType" value="resolvegroup">
                    <label for="resolvegroup">支持组</label>
                </div>

                <div ng-switch on="vm.d.assignType">
                    <div ng-switch-when="person">
                        <div class="form-group">
                            <!--                                <label style="padding: 0 0 5px">指派处理人</label>-->
                            <select ng-model="vm.p.responser" class="selectpicker" data-live-search="true" name="responser" data-size="10">
                                <option value="">选择处理人</option>
                                <option ng-repeat="x in vm.listUser" value="{{x.userName}}"
                                        data-tokens="{{x.userName}}" my-repeat-finish="repeatFinish()">{{x.userCn}}</option>
                            </select>
                        </div>
                    </div>

                    <div ng-switch-when="resolvegroup">
                        <div class="form-group"
                             ng-class="{'has-error':form.resolvegroupId.$error.required,'has-success':!form.resolvegroupId.$error.required}">
                            <div style="padding: 0 0 5px">支持组</div>
                            <select ng-disabled="vm.isDisabled" ng-model="vm.p.resolvegroupId"
                                    ng-options="x.resolvegroupId as x.name for x in vm.listResolveGroup" name="resolvegroupId"
                                    class="form-control" ng-change="getCtiById()">
                            </select>
                        </div>
                        <div class="form-group"
                             ng-class="{'has-error':form.ctiId.$error.required,'has-success':!form.ctiId.$error.required}">
                            <div style="padding: 0 0 5px">支持项</div>
                            <select ng-disabled="vm.isDisabled" name="ctiId" ng-model="vm.p.ctiId"
                                    ng-options="x as y.ctiName for (x,y) in ctis" class="form-control"></select>
                        </div>
<!--                            <div class="form-group">-->
<!--                                <div style="padding: 0 0 5px">指定处理人</div>-->
<!--                                <select ng-model="vm.p.responser" class="selectpicker" data-live-search="true" name="responser" data-size="10">-->
<!--                                    <option value="">当前值班人</option>-->
<!--                                    <option ng-repeat="x in vm.listUser" value="{{x.userName}}"-->
<!--                                            data-tokens="{{x.userName}}" my-repeat-finish="repeatFinish()">{{x.userCn}}</option>-->
<!--                                </select>-->
<!--                            </div>-->
                        <div class="form-group">
                            <div>
                                <input type="checkbox" ng-model="vm.p.isNotifyAdmin"> 通知组负责人
                            </div>
                            <div>
                                <input type="checkbox" ng-model="vm.p.isNotifyRg"> 通知组成员
                            </div>
                        </div>
                    </div>

                </div>

                <div class="form-group">
                    <input class="btn btn-primary" ng-class="{'disabled':!form.$valid}" type="submit" value="确定" ng-click="dealTicket()" />
                    <a href="#/star/onduty/ticket_list" class="btn btn-default">返回</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!--/.container-->